﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace GrayParrot.Web.Formly
{
    /// <summary>
    /// The direction in which are drawn the fields of the repeating section
    /// </summary>
    public enum DrawDirections
    {
        Row = 0,
        Col
    }

    /// <summary>
    /// The Repeating Section Template Options Attribute...
    /// </summary>
    public class RepeatingSectionTemplateOptionsAttribute : TemplateOptionsAttribute
    {
        /// <summary>
        /// Used to add descriptive text to all inputs...
        /// </summary>
        /// <value>
        /// The description.
        /// </value>
        [JsonProperty(PropertyName = "description")]
        [Obsolete, Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
        new private string Description { get; set; }

        /// <summary>
        /// Indicates the number and order of the fields present in the repeating section...
        /// </summary>
        /// <value>
        /// The fields.
        /// </value>
        [JsonProperty(PropertyName = "fields")]
        public string Fields { get; set; }

        /// <summary>
        /// Gets or sets the draw direction for the fields...
        /// </summary>
        /// <value>
        /// The draw direction.
        /// </value>
        [JsonProperty(PropertyName = "drawDirection")]
        public DrawDirections DrawDirection { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="RepeatingSectionTemplateOptionsAttribute"/> class.
        /// </summary>
        public RepeatingSectionTemplateOptionsAttribute()
        {

        }
    }
}
